import React, { FC } from 'react'
import { Swiper, Image, List, Ellipsis } from 'antd-mobile'
import { Link } from 'react-router-dom';


const GList: FC<any> = ({
    goods
}) => {
    return (
        <div className="glist">
            <ul style={{ minHeight: '100vh' }} className='ul'>
                {goods.map((item: any, index: number) => (
                    <li key={index} className={'item ' + (index % 2 == 0 ? 'odd' : 'even')} >
                        <Link to={'/good/' + item._id} >
                            <img src={item.img} alt="" />
                            <div className="ginfo">
                                <Ellipsis className="name" direction='end' rows={2} content={item.name} />
                                <div className='ops' style={{ display: 'flex' }}>
                                    <span className='price'>{item.price}</span>
                                    <span className='text'>{item.type.text}</span>
                                </div>
                            </div>
                        </Link>
                    </li>
                ))}
            </ul>
        </div>
    )
}

export default GList